<html>
<style>html,body{margin:0;padding:0;height:100%;-webkit-tap-highlight-color:rgba(0,0,0,0); -webkit-text-size-adjust:100%}th,td{vertical-align:center;text-align:center;background:#999;color:#fff;font:bold 2cm times;opacity:0.8;padding:0.3cm;cursor:pointer}input{border:0;background:#fff;width:100%;text-align:right;color:#000;padding:0.2cm;font:bold 2cm mono}table{background:#fff}</style>
<table cellspacing=1 border=0 width=100% height=100%>
<tr><th colspan=5 style="padding:4px;height:5%"><input id=calc value=0>
<tr><td>7<td>8<td>9<td>&radic;<td>C<tr>
<td>4<td>5<td>6<td>&times;<td>&divide;<tr>
<td>1<td>2<td>3<td rowspan=2>+<td>-<tr>
<td>0<td>&bull;<td>&plusmn;<td>=<tr>
</table>
<script>
function btn(t,n,v) {
  t.preventDefault();
  t=escape(t.target.innerHTML);
  n=document.getElementById("calc");
  v=n.value;

  if(/\.$/.test(v)) v+="0";
  if(!/\d ?$/.test(v)) v=v.substr(0, v.length-3);
  if(/ /.test(v)) v = eval(v);

  switch(t) {
    case "C": n.value = "0"; break;
    case "%3D": n.value = v; break;//=
    case "%u221A": n.value = Math.sqrt(eval(v)); break;
    case "%F7": n.value = v + " / "; break;
    case "%D7": n.value = v + " * "; break;
    case "%B1": n.value = -1*v; break;

    case "+":
    case "-": n.value = v + " " + t + " "; break;

    case "%u2022": t = (!v || v == "0") ? "0." : ".";
    default: n.value = (!v || v == "0") ? t : n.value + t;
  }
}
[].forEach.call(document.getElementsByTagName("td"),function(n){
if("ontouchstart" in n) {n.onclick=function(){};n.ontouchstart=btn;}else n.onclick=btn
})</script>
</html>